package com.jxm.spring.security.controller;


import com.baomidou.mybatisplus.extension.api.R;
import com.jxm.spring.security.bean.DmAllplatOrderItemCatnameCountDay;
import com.jxm.spring.security.service.IDmAllplatOrderItemCatnameCountDayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 每日商品类目销售表 前端控制器
 * </p>
 *
 * @author jxm
 * @since 2021-06-20
 */
@RestController
@RequestMapping("/dm")
public class DmAllplatOrderItemCatnameCountDayController {

    @Autowired
    private IDmAllplatOrderItemCatnameCountDayService catnameCountDayService;

    @GetMapping("/list")
    public R getList(){
        try {
            System.out.println("---------------list-"+new Date());
            List<DmAllplatOrderItemCatnameCountDay> list2 = catnameCountDayService.getList2();
            System.out.println("---------------list-"+new Date());
            System.out.println("--list--"+list2.size());
            System.out.println("---------------list2-"+new Date());
            List<DmAllplatOrderItemCatnameCountDay> list = catnameCountDayService.list();
            System.out.println("-----------------list2---"+new Date());
            System.out.println("-list2-"+list.size());
            return R.ok(list2.size());
        } catch (Exception e) {
            e.printStackTrace();
            return R.failed("ll");
        }
    }

    @GetMapping("/list2")
    public R getList2(){
        System.out.println("-list2-"+new Date());
        List<DmAllplatOrderItemCatnameCountDay> list = catnameCountDayService.list();
        System.out.println("--"+new Date());
        System.out.println("-list2-"+list.size());
        return R.ok("ff");
    }

}
